package com.ruoyi.eqmonitor.smdtv.controller;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.eqmonitor.smdtv.service.ISmdtv9Service;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "微站")
@RestController
@RequestMapping("/smdtv9")
public class Smdtv9Controller {

    @Resource
    private ISmdtv9Service ISmdtv9Service;

    /**
     * 根据水系名称获取微站
     * @param name 水系名
     */
    @ApiOperation("根据水系名称获取微站")
    @GetMapping("/getByName")
    public AjaxResult getByName(String name){
        return AjaxResult.success(ISmdtv9Service.getByName(name));
    }

    /**
     * 微站多选下拉框
     */
    @ApiOperation("微站多选下拉框")
    @GetMapping("/getAllName")
    public AjaxResult getAllName(){
        return AjaxResult.success(ISmdtv9Service.getAllName());
    }

    /**
     * 根据街道名称获取微站
     * @param areaName 街道名称
     */
    @ApiOperation("根据街道名称获取微站")
    @GetMapping("/getByAreaName")
    public AjaxResult getByAreaName(String areaName){
        return AjaxResult.success(ISmdtv9Service.getByAreaName(areaName));
    }

}
